﻿using Microsoft.Extensions.DependencyInjection;

namespace ESoft.Zookeeper
{
    public static class ServiceCollectionExtensions
    {
        public static void AddZookeeper(this IServiceCollection services, string connectStr)
        {
            ZookeeperClient zookeeper = new ZookeeperClient(connectStr, 200);
            services.AddSingleton(zookeeper);
            services.AddSingleton<IZooKeeperService, ZooKeeperService>();
        }
    }
}
